﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using AuthUser.ServiceReference1;
namespace AuthUser
{
    public partial class MainPage : UserControl
    {
        private Service1Client service = new Service1Client();
        public MainPage()
        {
            InitializeComponent();
            service.LoginCompleted += service_LoginCompleted;
        }

        private void Button_Click_1(object sender, RoutedEventArgs e)
        {

           
            service.LoginAsync("LDAP://minhson.com", txtuser.Text, txtpass.Text);
        }

        void service_LoginCompleted(object sender, LoginCompletedEventArgs e)
        {

            if (e.Error != null) { MessageBox.Show("Loi");  }
            else
            {
                MessageBox.Show("ket qua"+e.Result);               
            }
            
        }
    }
}
